﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MS.InformationManagement.Presenter.Support;
using MS.InformationManagement.Support;
using Microsoft.SharePoint;
using System.Web;

namespace MS.InformationManagement.Presenter.SearchUser
{
    public class SearchUserPresenter : BasePresenter<ISearchUserView>
    {
        #region Constructors
        
        public SearchUserPresenter(ISearchUserView view) : base(view) { }

        #endregion

        #region Methods

        public void HandleLoad()
        {
            int totalRecords = 0;
            if (View.CedulaUsuario != string.Empty) { View.UsuarioID = MS.InformationManagement.BLL.SearchUser.SearchUser.GetIdByCedula(View.CedulaUsuario); }
            if (View.Departamento != null) { View.listUsuariosDepartamento = MS.InformationManagement.BLL.SearchUser.SearchUser.GetUsersByDepartment(View.Departamento, View.PageIndex, View.PageSize, out totalRecords); }
            View.TotalRecords = totalRecords;
            View.Show();
        }

        #endregion
    }
}
